package cn.xinzhi.test;

import cn.xinzhi.dao.IDeptDao;
import cn.xinzhi.entity.UserInfo;
import cn.xinzhi.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class Mybatis_Main_tomto1 {
    public static void main(String[] args) {
        SqlSession ss = MyBatisUtil.getSqlSession();
        IDeptDao idd = ss.getMapper(IDeptDao.class);
        List<UserInfo> lists = idd.getDeptByUser(1);
        for (UserInfo ui:lists) {
            System.out.println(ui.getUsername()+ui.getDept().getDeptname());
        }

    }
}
